from PyQt5.QtWidgets import QApplication,QWidget,QLabel,QLineEdit,QTextEdit,QVBoxLayout
from PyQt5.QtWidgets import QPushButton,QHBoxLayout,QFormLayout,QMessageBox
from PyQt5.QtGui import QIcon,QPixmap
import sys
def click_user():
    reply = QMessageBox.question(window, '提示', '确定要删除用户吗？', QMessageBox.Yes | QMessageBox.Cancel, QMessageBox.Cancel)
    if reply == QMessageBox.Yes:
        print("删除")
        
if __name__ == "__main__":
    # 创建QApplication对象
    app=QApplication(sys.argv)
    #创建窗口
    window=QWidget()
    #命名窗口
    window.setWindowTitle("上位机")
    #指定图标
    window.setWindowIcon(QIcon("gege.png"))
    #设置窗口大小
    window.resize(1000, 800)
    #——————————————————————————————————————组件初始化
    root_layout = QHBoxLayout(window)
    btn=QPushButton("删除用户")
    btn.clicked.connect(click_user)
    root_layout.addWidget(btn)
    # window.setLayout(root_layout)

    #_____________________________________
    #显示窗口
    window.show()
    #鼠标悬浮文字
    window.setToolTip("你好")
    #结束
    sys.exit(app.exec_())
    